/**
 * 
 */
package com.ntv.service.obituary;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.ntv.domain.IObituary;
import com.ntv.domain.Obituary;
import com.ntv.persistent.PersistentException;
import com.ntv.persistent.obituary.IObituaryDao;
import com.ntv.service.DomainException;

/**
 * @author Kavi
 * @Since 04/02/2009
 */
public class ObituaryAppService implements IObituaryAppService {
	
	@Autowired
	private IObituaryDao obituaryDao;
	
	public void setObituaryDao(IObituaryDao obituaryDao) {
		this.obituaryDao = obituaryDao;
	}

	public List<IObituary> getRecentObituaries() throws DomainException {
		
		try {
			return this.obituaryDao.getRecentObituaries();
		} catch (PersistentException e) {
			throw new DomainException(e);
		}
	}

	public Obituary getObituaryById(Obituary obituary) throws DomainException {
		try {
			return this.obituaryDao.getObituaryById(obituary);
		} catch (PersistentException e) {
			throw new DomainException(e);
		}
	}

	public void saveObituary(Obituary obituary) throws DomainException {
		try {
			this.obituaryDao.saveObituary(obituary);
		} catch (PersistentException e) {
			throw new DomainException(e);
		}
		
	}
	
}
